<#assign module="gasstation"/>

<@override name="header">
</@override>
<@override name="body">

<div class="row">
	<div class="col-xs-12">
		<ul class="nav nav-tabs">
            <li><a href="${ctx}/gasstation/edit/${gsid}">基本信息</a></li>
            <li class="active"><a href="${ctx}/gasstation/editGasPrice/${gsid}">油价设置</a></li>
            <li><a href="${ctx}/gasstation/paymentsRecord/${gsid}">资金流水</a></li>
            <li><a href="${ctx}/gasstation/review/${gsid}">油站评价</a></li>
        </ul>
	</div>
</div>

<div class="tabta-content"> 
    <div class="panel">
        <div class="panel-body">
            <table class="table table-condensed table-striped" style="width:1080px;">
				<tbody>
					<tr>
						<th style='width:25%;text-align:center;'>油号</th>
						<th style='width:25%;text-align:center;'>价格 <span id="price-title" class="glyphicon glyphicon-question-sign" aria-hidden="true" data-toggle="tooltip"></span></th>
						<th style='width:25%;text-align:center;'>直降 <span id="straightDown-title" class="glyphicon glyphicon-question-sign" aria-hidden="true" data-toggle="tooltip"></span></th>
						<th style='width:25%;text-align:center;'>排序 <span id="sort-title" class="glyphicon glyphicon-question-sign" aria-hidden="true" data-toggle="tooltip"></span></th>
					</tr>
					<#if prices?? >
					  	<#list prices as price>
							<tr>
								<td style="text-align:center;">${price.gasNum?if_exists}</td>
								<td style="text-align:center;">
									<div class="show-price">
										￥<span class="show-price-span">${price.price?if_exists}</span>&nbsp;&nbsp;
										<button type="button" class="btn btn-default btn-xs edit-price-button">
										  <span class="glyphicon glyphicon-edit" aria-hidden="true"></span>
										</button>
									</div>
									<div class="input-group input-group-sm edit-price" style="display:none;">
								    	<input type="text" class="form-control edit-price-input" value="${price.price?if_exists}" max="1000" placeholder="0表示不卖该油">
								    	<span class="input-group-btn">
								        	<button class="btn btn-primary save-price" type="button" data-id="${price.id}">保存</button>
							    		</span>
								    </div>
								</td>
								<td style="text-align:center;">
									<div class="show-straightDown">
										<span class="show-straightDown-span">${price.straightDown?if_exists}</span>&nbsp;&nbsp;
										<button type="button" class="btn btn-default btn-xs edit-straightDown-button">
											<span class="glyphicon glyphicon-edit" aria-hidden="true"></span>
										</button>
									</div>
									<div class="input-group input-group-sm edit-straightDown" style="display:none;">
								    	<input type="text" class="form-control edit-straightDown-input" value="${price.straightDown?if_exists}" placeholder="APP中显示">
								    	<span class="input-group-btn">
								        	<button class="btn btn-primary save-straightDown" type="button" data-id="${price.id}">保存</button>
							    		</span>
								    </div>
								</td>
								<td style="text-align:center;">
									<div class="show-sort">
										<span class="show-sort-span">${price.sort?if_exists}</span>&nbsp;&nbsp;
										<button type="button" class="btn btn-default btn-xs edit-sort-button">
										  <span class="glyphicon glyphicon-edit" aria-hidden="true"></span>
										</button>
									</div>
									<div class="input-group input-group-sm edit-sort" style="display:none;">
								    	<input type="number" min="1" max="9" class="form-control edit-sort-input" value="${price.sort?if_exists}" placeholder="序号小的排在前">
								    	<span class="input-group-btn">
								        	<button class="btn btn-primary save-sort" type="button" data-id="${price.id}">保存</button>
							    		</span>
								    </div>
								</td>
							</tr>
						</#list>
					</#if>
				</tbody>
			</table>
        </div>
    </div>
	
</div>

</@override>
<@override name="footer">
<script src="${ctx}/assets/js/gasstation/editgasprice.js"></script>
<script type="text/javascript">
</script>
</@override>
<@extends name="../layout.ftl"/>
